import request from '@/utils/request'

export function fetchList(listQuery) {
  return request({
    url: '/getDocumentEntityInfo',
    method: 'post',
    data: {
      dataName: listQuery.dataName,
      dataType: listQuery.dataType,
      author: listQuery.author
    },
    params: {
      pageNum: listQuery.page,
      pageSize: listQuery.limit
    }
  })
}

export function updateData(data,username) {
  return request({
    url: '/updateDataInfo',
    method: 'post',
    data,
    params: {
     username
    }
  })
}

export function updateDocumentEntityInfo(data,token) {
  return request({
    url: '/updateDocumentEntityInfo',
    method: 'post',
    data,
    params:{
      token: token
    }
  })
}

export function getDocumentEntityDetail(id) {
  return request({
    url: '/getDocumentEntityDetail',
    method: 'get',
    params: { id }
  })
}


export function fetchDataLogList(listQuery) {
  return request({
    url: '/getDataLogInfo',
    method: 'post',
    data: {
      username: listQuery.username,
      model: listQuery.model,
      type: listQuery.type
    },
    params: {
      pageNum: listQuery.page,
      pageSize: listQuery.limit
    }
  })
}

export function fakeDelete(id) {
  return request({
    url: '/deletDocumentEntityByID/' + id,
    method: 'delete'
  })
}